var {
  randomUtils,
  clickUtils,
  swipeUtils,
  timeUtils,
  logUtils,
} = require ('../../utils/index');
var {Action} = require ('../../base/index');
var pointMap = require ('./pointMap');
var aRead = new Action ('阅读', {});
aRead.exec = function () {
  if (randomUtils.possible (10, 30)) {
    this.read ();
  } else {
    clickUtils.clickPointMap (pointMap.首页.视频);
    sleep (randomUtils.getRandom (3, 5, 1000));
    this.watch ();
  }
};
aRead.read = function () {
  var span = randomUtils.getRandom (5, 25, 1000);
  logUtils.info ('将阅读' + span / 1000 + '秒');
  sleep (span);
  return;
};
aRead.watch = function () {
  var baseSpan = 10;
  var span = randomUtils.getRandom (baseSpan, baseSpan + 20, 1000);
  logUtils.info ('将watch：', span / 1000, '秒');
  sleep (span);
  return;
};
module.exports = aRead;
